// base
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
// less
import './index.less'
import If from '../../../../components/page-components/if'
import ShowEmpty from '../../../../components/page-components/show-empty'
import AlumniMessageList from '../../../../components/page-components/alumni-message-list'
import BottomLoading from '../../../../components/page-components/bottom-loading'
import TopLoading from '../../../../components/page-components/top-loading'

class ResumeScrollWrap extends Component {

  render () {
    const { dataSource, requestOverTop } = this.props
    return (
      <View className="ResumeScrollWrap_id75870">
        <If visible={!requestOverTop}>
          <TopLoading />
        </If>
        <If
          visible={requestOverTop && dataSource && !dataSource.showLeftEmpty && dataSource.dataSource && dataSource.dataSource.length}
          renderElse={<ShowEmpty />}
        >
          <AlumniMessageList dataSource={dataSource.dataSource} />
          <BottomLoading haveNext={dataSource.haveNextPersonPage} />
        </If>
      </View>
    )
  }
}

ResumeScrollWrap.defaultProps = {
  dataSource: {
    dataSource: []
  }
}

export default ResumeScrollWrap
